package day_13;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;

public class TestIn {

    public static void main(String[] args) throws Exception {
        //method();
        method2();
    }


    private static void method2() throws Exception {
        InputStream in =null;
        in=new BufferedInputStream(new FileInputStream("D:\\java\\1.txt"));

        int b;
        while ((b = in.read()) != -1) {
            System.out.println(b);
        }
        in.close();

    }


    private static void method() throws Exception {
        InputStream in = null;
        in = new FileInputStream("D:\\java\\1.txt");
        //InputStream in = new FileInputStream("D:\\java\\1.txt");
//        System.out.println(in.read());
//        System.out.println(in.read());
//        System.out.println(in.read());
        int b;
        while ((b = in.read()) != -1) {
            System.out.println(b);
        }
        in.close();
    }

}
